package com.demo2do.fms.entity.supplier.common;

import com.demo2do.core.utils.Alias;

/**
 * 
 * @author mohanlan
 *
 */
@Alias("SupplierSyncStatus")
public enum SyncStatus {
    
    MODIFIED("modified", "变更申报待审核"),
    
    ADOPT("adopt", "申报合格"),
    
    REJECTED("rejected", "申报驳回");
    
    private String alias;
    
    private String description;
    
    
    /**
     * @param alias
     * @param description
     */
    private SyncStatus(String alias, String description) {
        this.alias = alias;
        this.description = description;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static SyncStatus aliasOf(String alias) {
        
        for (SyncStatus syncStatus : SyncStatus.values()) {
            if (syncStatus.getAlias().equalsIgnoreCase(alias)) {
                return syncStatus;
            }
        }
        
        return null;
    }
    
    /**
     * @return
     */
    public boolean isModified() {
        return this.equals(MODIFIED);
    }
    
    /**
     * 
     * @return
     */
    public boolean isAdopt() {
        return this.equals(ADOPT);
    }
    
    /**
     * 
     * @return
     */
    public boolean isRejected() {
        return this.equals(REJECTED);
    }

    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

}
